<#if dbExchangerImplVars.importAnnotationClassDefineArea?has_content>
${abs.importAnnotationClassDefineAreaStartMark}
${dbExchangerImplVars.importAnnotationClassDefineArea}
${abs.importAnnotationClassDefineAreaEndMark}
<#else>
${abs.importAnnotationClassDefineAreaStartMark}
package ${dbExchangerImplVars.packageName};

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import ${boVars.packageName}.${entity}BO;
import ${dbExchangerVars.packageName}.${entity}DbExchanger;
import ${iServiceVars.packageName}.${entity}IService;
import ${doVars.packageName}.${entity}DO;
import ${mapperVars.packageName}.${entity}Mapper;
import com.xieyang.inner.common.spring.util.XBeanUtils;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ${entity}DbExchangerImpl implements ${entity}DbExchanger {
${abs.importAnnotationClassDefineAreaEndMark}
</#if>

    @Resource
    ${entity}Mapper ${entity?substring(0,1)?lower_case + entity?substring(1)}Mapper;

    @Resource
    ${entity}IService ${entity?substring(0,1)?lower_case + entity?substring(1)}IService;

    @Override
    public ${entity}BO biz() {
        ${entity}BO ${entity?substring(0,1)?lower_case + entity?substring(1)}BO = new ${entity}BO();
        LambdaQueryWrapper<${entity}DO> queryWrapper = new LambdaQueryWrapper<>();
        List<${entity}DO> ${entity?substring(0,1)?lower_case + entity?substring(1)}DOList = ${entity?substring(0,1)?lower_case + entity?substring(1)}IService.list(queryWrapper);
        if (!CollectionUtils.isEmpty(${entity?substring(0,1)?lower_case + entity?substring(1)}DOList)) {
            ${entity?substring(0,1)?lower_case + entity?substring(1)}BO = XBeanUtils.convert(${entity?substring(0,1)?lower_case + entity?substring(1)}DOList.get(0), ${entity}BO.class);
        }
        return ${entity?substring(0,1)?lower_case + entity?substring(1)}BO;
    }

    ${abs.customerAreaStartMark}
${dbExchangerImplVars.customerArea}
    ${abs.customerAreaEndMark}


}
